// app.js
App({
  onLaunch() {
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    })
    // 获取系统的状态栏的高度
    wx.getSystemInfo(
      {
        success: (rel) => {
          // 获取是px值
          // 状态栏的高度
          console.log(rel.statusBarHeight);
          // 视口的宽度
          console.log(rel.windowWidth);

          // 转化为rpx然后获取
          // rel.statusBarHeight*(750/rel.windowWidth)
          this.globalData.navBarHeight = rel.statusBarHeight * (750 / rel.windowWidth) + 88;
          this.globalData.screenHeight = rel.screenHeight* (750 / rel.windowWidth);

        }
      }
    )



  },
  // 全局变量
  globalData: {
    userInfo: null,
    navBarHeight: null,
    screenHeight:null
  }
})
